﻿using System;
using System.Collections.Generic;

namespace EmployManage
{
    public class Employ
    {
        public string No { get; set; }
        public string Name { get; set; }
        public string Sex { get; set; }
        public string Tel { get; set; }
        public override string ToString()
        {
            return $"编号:{No}\t姓名:{Name}\t性别:{Sex}\t电话:{Tel}";
        }
    }


    class Program
    {
        static List<Employ> employs = new List<Employ>();
        public static void Add()
        {
            int i = 1;
            string str = "";
            while (str != "ok")
            {
                Console.WriteLine("请输入第{0}个员工的编号：", i);
                string no = Console.ReadLine();
                Console.WriteLine("请输入第{0}个员工的姓名：", i);
                string name = Console.ReadLine();
                Console.WriteLine("请输入第{0}个学生的性别：", i);
                string sex = Console.ReadLine();
                Console.WriteLine("请输入第{0}个学生的电话：", i);
                string tel = Console.ReadLine();
                employs.Add(new Employ { No = no, Name = name, Sex = sex, Tel = tel });
                i = i + 1;
                Console.WriteLine("输入 ok 停止新增，按空格键继续。。");
                str = Console.ReadLine();
            }
        }

        public static void Show()
        {
            foreach (Employ employ in employs)
            {
                Console.WriteLine(employ);
            }
        }
        static void Main(string[] args)
        {
            Console.WriteLine("**************欢迎来到学生管理系统***************");


            string str = "";
            while (str != "end")
            {
                Console.WriteLine("-----请选择-----");
                Console.WriteLine("0-> 查看信息");
                Console.WriteLine("1-> 新增学生");
                Console.WriteLine("2-> 退出系统");
                switch (Console.ReadLine())
                {
                    case "0":
                        Show();
                        break;
                    case "1":
                        Console.WriteLine();
                        Add();
                        break;
                    default:
                        Console.WriteLine("退出系统成功！");
                        str = "end";
                        break;

                }
            }
            Console.WriteLine("程序结束!");
        }
    }
}
